package com.naiterui.ehp.bs.consult.repository;

import com.naiterui.common.repository.core.BaseJpaRepository;
import com.naiterui.ehp.bp.domain.DrVideoGroupConsult;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Set;

/**
 * 会诊持久层
 *
 * @author gaoliangliang
 * @date 2022年07月05日 13:54:01
 **/
@Repository
public interface DrGroupConsultRepository extends BaseJpaRepository<DrVideoGroupConsult, Long> {

    DrVideoGroupConsult findFirstByVideoConsultId(Long videoConsultId);

    DrVideoGroupConsult findFirstByRoomId(Integer roomId);

    Page<DrVideoGroupConsult> findByDoctorIdOrderByIdDesc(Long doctorId, Pageable pageable);

    Page<DrVideoGroupConsult> findByDoctorIdOrTargetDoctorIdOrderByIdDesc(Long doctorId, Long targetDoctorId, Pageable pageable);

    List<DrVideoGroupConsult> findByVideoConsultIdIn(Set<Long> videoConsultIds);

}
